<?php
($uid = session('user_id')) || abort('请先登录!');
// 昵称
($alias = _POST('alias', '')) || abort(30);
$db->autoExecute('users', ['alias' => $alias], "UPDATE", "user_id=$uid") || abort(36);
$_SESSION['user']['name'] = $alias;
return ['alias'=>$alias];